package com.xiaoxu.privatechat.dao.admin;
import com.xiaoxu.privatechat.entity.admin.Menu;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * @description 后台菜单数据库操作层
 * @author xiaoxu
 * @date 2023/2/13
 */
@Repository
public interface MenuDao extends JpaRepository<Menu, Long> {
	/**
	 * @description 根据id查询菜单权限
	 * @param id 菜单id
	 * @return Menu
	 */
	@Query("select m from Menu m where m.id = :id")
	Menu find(@Param("id")Long id);
}
